package com.jumper.study.front.dto.resp;

public class MyLessonListItemResp {
    private Long id;

    private String title;

    private String thumb;

    private Long chapterId;

    private String chapterTitle;

    private Long totalDuration;

    private Long studyTimes;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getThumb() {
        return thumb;
    }

    public void setThumb(String thumb) {
        this.thumb = thumb;
    }

    public Long getChapterId() {
        return chapterId;
    }

    public void setChapterId(Long chapterId) {
        this.chapterId = chapterId;
    }

    public String getChapterTitle() {
        return chapterTitle;
    }

    public void setChapterTitle(String chapterTitle) {
        this.chapterTitle = chapterTitle;
    }

    public Long getTotalDuration() {
        return totalDuration;
    }

    public void setTotalDuration(Long totalDuration) {
        this.totalDuration = totalDuration;
    }

    public Long getStudyTimes() {
        return studyTimes;
    }

    public void setStudyTimes(Long studyTimes) {
        this.studyTimes = studyTimes;
    }

    public Long getProgress() {
        if (totalDuration == null || totalDuration <= 0 || studyTimes == null || studyTimes <= 0) {
            return 0l;
        }

        Long percent = studyTimes * 100 / totalDuration;
        return percent > 100 ? 100 : percent;
    }
}
